package com.zx.service.order.impl;

import com.zx.config.exception.BaseBusinessException;
import com.zx.config.exception.BizError;
import com.zx.dao.order.StateMapper;
import com.zx.dto.request.order.OrderDtoRequest;
import com.zx.service.order.StateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author sunkai
 * @date 2022/8/22 0022 15:33
 * @mood zhou xun
 */
@Service
public class StateServiceImpl implements StateService {

    @Autowired
    private StateMapper stateMapper;
    @Override
    public boolean addState(List<OrderDtoRequest> orderDtoRequest) {
        int i = stateMapper.addState(orderDtoRequest);
        if (i<=0){
          throw new BaseBusinessException(BizError.ORDER_JOURNAL_ERROR.getErrorCode(),BizError.ORDER_JOURNAL_ERROR.getErrorCode());
        }
        return true;
    }
}
